import request from '@/utils/request'

/**
 *
 * @param {*} params {page, pageSize, carNumber, personName, cardStatus}
 * @returns
 */
export function getCardListApi(params) {
  return request({
    method: 'GET',
    url: '/parking/card/list',
    params
  })
}

/**
 *
 * @param {*} data {personName, phoneNumber, carNumber, cardStartDate, cardEndDate, paymentAmount, paymentMethod}
 * @returns
 */
/**
 * 新增月卡
 * @param {} data
 * @returns
 */
export function createCardApi(data) {
  return request({
    method: 'POST',
    url: '/parking/card',
    data
  })
}

/**
 * 查看月卡详情
 * @param {*} id
 * @returns
 */
export function getDetailAPI(id) {
  return request({
    url: `/parking/card/detail/${id}`
  })
}

/**
 * 更新月卡
 * @param {} data
 * @returns
 */
export function updateCardApi(data) {
  return request({
    url: `/parking/card/edit`,
    method: 'PUT',
    data
  })
}

/**
 * 删除月卡
 * @param {*} id
 * @returns
 */
export function delCardApi(id) {
  return request({
    url: `/parking/card/${id}`,
    method: 'DELETE'
  })
}
